//检查地址空间
static GLOBAL: i32 = 1000; //全局静态变量

fn noop() -> *const i32 {
    let noop_local = 12345; //noop的局部变量，存在于main()外部的一个内存地址中
    &noop_local as *const i32 //转换为原始指针
}
fn main() {
    let local_str = "a";
    let local_int = 123;
    let boxed_str = Box::new('b');
    let boxed_int = Box::new(789);
    let fn_int = noop();

    println!("GLOBAL:     {:p}", &GLOBAL as *const i32);
    println!("local_str:  {:p}", local_str as *const str);
    println!("local_int:  {:p}", local_int as *const i32);
    println!("boxed_int:  {:p}", Box::into_raw(boxed_int));
    println!("boxed_str:  {:p}", Box::into_raw(boxed_str));
    println!("fn_int:     {:p}", fn_int);
}
